/**
 * 
 */
package me.myachievements.web.restricted.account;

import me.myachievements.persistence.account.Account;
import me.myachievements.persistence.account.AccountPersistenceManager;

import me.myachievements.web.restricted.RestrictedPage;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.spring.injection.annot.SpringBean;

/**
 * @author besseym
 *
 */
public class AccountDetailsPage extends RestrictedPage {

	@SpringBean(name="accountPersistenceManager")
	AccountPersistenceManager accountPersistenceManager;

	/**
	 * Constructor
	 * @param pageParameters
	 */
	public AccountDetailsPage() {
		
		Account account = this.getMyAchievementsSession().getAccount();
		setDefaultModel(new CompoundPropertyModel<Account>(account));
		
		add(new Label("id"));
		add(new Label("username"));
		add(new Label("email"));
		add(new Label("name"));
		add(new Label("createdOn"));
		add(new Label("updatedOn"));
		
		add(new Link("edit"){

			@Override
			public void onClick() {
				setResponsePage(new UpdateAccountPage());
			}
			
		});
	}

}
